﻿using System.Collections.Generic;
using Baosight.ZNH.ZMCommon;
using Baosight.Platform.Core;
using Baosight.Platform.Core.UI.Controls;
using Baosight.ZNH.ZMCM.UI.Utils;


namespace Baosight.ZNH.ZMCM.UI
{
    public partial class ZMCM91 : EFViewCmes
    {
        private MonthBlock monthBlock = new MonthBlock();//构造前台是否下拉列表

        public ZMCM91()
        {
            InitializeComponent();
        }

        public override void Initialize(EIInfo initData)
        {
            initData.AddBlock(monthBlock.GetMonth(true));//月份下拉框
            base.Initialize(initData);
        }
        
        private void grid_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
        {
            if (null != this.grid.SelectedItem)
            {
                var fdKeyId = this.grid.SelectedItem.GetType().GetProperty("fdKeyId").GetValue(this.grid.SelectedItem, null);
                var fdYear = this.grid.SelectedItem.GetType().GetProperty("fdYear").GetValue(this.grid.SelectedItem, null);
                var fdMonth = this.grid.SelectedItem.GetType().GetProperty("fdMonth").GetValue(this.grid.SelectedItem, null);
                Dictionary<string, string> args = new Dictionary<string, string>();
                args.Add("fdHisKeyId", fdKeyId.ToString());
                args.Add("fdYear", fdYear.ToString());
                args.Add("fdMonth", fdMonth.ToString());
                this.container.LoadView("ZMCM92", args);
            }
            else
            {
                this.container.Content = null;
            }
        }
    }
}
